import Explain from "./Explain"
import ExplainProps from "./ExplainProps"
import ExplainRef from "./ExplainRef"
import ExplainStateA from "./ExplainState/A"
import ExplainStateB from "./ExplainState/B"
import ExplainExtendsA from './ExplainExtends/A'
import ExplainExtendsB from './ExplainExtends/B'
import './index.css'
const HOCHome = () => (
  <div className='HOCHomeContainer'>
    <Explain />
    <ExplainProps name={"小毅"} sex={"女"} grad={100} />
    <ExplainProps name={"小花"} age={20} grad={60} />
    <ExplainRef />
    <ExplainStateA />
    <ExplainStateB />
    <ExplainExtendsA />
    <ExplainExtendsB />
  </div>
)
export default HOCHome




// const HOCHome = () => {
//   console.log("====================高阶组件==================");
// 高阶函数里，函数可以作为参数被传递
// setTimeout(function () {
//   console.log('setTimeout');
// }, 1000)

// setInterval(() => {
//   console.log("setInterval")
// }, 2000)

// $for.get('/api/getUerInfo',function(){
//   console.log("获取成功");
// })
// // 高阶函数在数组中的应用
// let arr = [1, 2, 3, 4, 5, 6]

// let result = null
// result = arr.some(item => {
//   return item === 2
// })
// console.log("some", result); //some true

// result = arr.every(item => {
//   return item > 3
// })
// console.log("every", result); // every false

// result = arr.filter(item => {
//   return item > 3
// })
// console.log("filter", result); // filter (3) [4, 5, 6]


// result = arr.forEach(item => {
//   return item % 2 === 0
// }, 'forEach的二个参数')
// console.log("foreach", result); // foreach undefined



//   return (
//     <div>
//       <h2>开启高阶组件学习</h2>
//     </div>
//   )
// }
